package org.wlw.arr;

public class TestArray {
    public static void main(String[] args) {
        //创建了一个数组，长度是10
        //还可以使用int nums[]
        int[] nums = new int[10];
        //访问第三个元素
        System.out.println(nums[2]);
        //nums[10],最多只能到nums[9]
        //数组可以在创建的时候直接赋值
        String[] s = {"abc","ddd","eee","f","gh","fdf","as","fdf","gsg","aaa"};
        System.out.println(s);
        s[3] = "啊哈哈哈哈哈";
        //数组的遍历
        for(int i=0;i<s.length;i++) {
            System.out.println(s[i]);
        }
    }
}
